// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

'use strict';

chrome.runtime.onInstalled.addListener((details) => {
  const reason = details.reason
  if (reason === 'install') {
    setDefaultSettings();
  }
});

function setDefaultSettings() {
  chrome.storage.sync.set({bgcolor: ''});
  chrome.storage.sync.set({csdn:true});
  chrome.storage.sync.set({wenku:true});
  chrome.storage.sync.set({jb51:true});
  chrome.storage.sync.set({doc360:true});
  chrome.storage.sync.set({sohu:true});
  chrome.storage.sync.set({jianshu:true});
  chrome.storage.sync.set({donate:true});
  chrome.storage.sync.set({baidusearch:true});

  chrome.storage.sync.set({i_csdn:true});
  chrome.storage.sync.set({i_doc360:true});
  chrome.storage.sync.set({i_jb51:true});
  chrome.storage.sync.set({i_sohu:true});
  chrome.storage.sync.set({i_jianshu:true});
}